package com.whynot.frame.manythread;

/**
 * 还原多线程，不做线程安全，产生数据异常的问题
 * @author Administrator
 *
 */
public class MyThread extends Thread{
	
	private  int num = 5;
	
	
	@Override
	public void run() {
		num--;
		System.out.println("当前num="+num);
	}



	public static void main(String[] args) {
		MyThread my = new MyThread();
		Thread t1 = new Thread(my, "t1");
		Thread t2 = new Thread(my, "t2");
		Thread t3 = new Thread(my, "t3");
		Thread t4 = new Thread(my, "t4");
		Thread t5 = new Thread(my, "t5");
		t1.start();
		t2.start();
		t3.start();
		t4.start();
		t5.start();
		
		
	}
}
